package com.demo.one_1.factory;

import com.demo.one_1.service.ProductionService;
import com.demo.one_1.service.impl.HeadsetServiceImpl;
import com.demo.one_1.service.impl.KeyboardServiceImpl;
import com.demo.one_1.service.impl.MouseServiceImpl;

/**
 * @author SunChangSheng
 * @apiNote 生产工厂
 * @since 2021/12/15 10:20
 */
public class ProductionFactory {
    public ProductionService product(Integer type) {
        if (type == 1) {
            return new MouseServiceImpl();
        } else if (type == 2) {
            return new KeyboardServiceImpl();
        } else if (type == 3) {
            return new HeadsetServiceImpl();
        }
        return null;
    }
}
